package 练习;

import java.util.Arrays;

public class 数组转字符串 {
    public static void main(String[] args) {
        int[] array = {1,2,3,4};
//        String s = Arrays.toString(array);
//        System.out.println(s);
        String s = fun1(array);
        System.out.println(s);
    }
    public static String fun1(int[] array){
        String s = "[";
        for(int i = 0;i<array.length;i++){
            s = s+array[i];
            if(i!= array.length-1){
                s = s+",";
            }
        }
        s = s+"]";
        return s;
    }
}

